﻿@model IEnumerable<Project_KhuyenMaiVang.Models.CommentDTO>
@{
    ViewBag.Title = "QuanLyComment";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    List<Project_KhuyenMaiVang.Models.AccountDTO> accountList = ViewBag.AccountList;
    List<Project_KhuyenMaiVang.Models.TinKhuyenMaiDTO> tinKMList = ViewBag.TinKMList;
}
<script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.tablesorter.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.tablesorter.pager.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#myTable").tablesorter();
        $("#myTable").hide();
        $("#myTable").toggle(500);
    }
); 
</script>

<table id="myTable" class="tablesorter" border="1">
    <thead>
    <tr>
        <th>
            Tin Khuyến Mãi
        </th>
        <th>
            User Name
        </th>
        <th>
            Ngày Comment
        </th>
        <th>
            Nội Dung
        </th>
        <td>
            Hành Động
        </td>
    </tr>
    </thead>
    @for (int i = 0; i < Model.Count(); i++)
    {
        <tr>
            <td>
                @Html.Label(tinKMList.ElementAt(i).ThongTinTomTat)
            </td>
            <td>
                @Html.Label(accountList.ElementAt(i).UserName.ToString())
            </td>
            <td>
                @Html.Label(Model.ElementAt(i).NgayComment.ToString())
            </td>
            <td>
                @Html.Label(Model.ElementAt(i).NoiDung)
            </td>
            <td>
                @Html.ActionLink("Cập nhật", "Edit", "Comment", new { maTin = Model.ElementAt(i).MaTinKhuyenMai, idAccount = Model.ElementAt(i).IDAccount, noiDung = Model.ElementAt(i).NoiDung }, null)
                |
                @Html.ActionLink("Xóa", "Delete", "Comment", new { maTin = Model.ElementAt(i).MaTinKhuyenMai, idAccount = Model.ElementAt(i).IDAccount, noiDung = Model.ElementAt(i).NoiDung }, null)
            </td>
        </tr>
    }
</table>
